import React from 'react';
import './addfavorite.css'
import icon_add_home from '@/assets/icon_add_home.png'
import icon_add_home_white from '@/assets/icon_add_home_white.png'
import icon_add_home_theme from '@/assets/icon_add_home_theme.png'
import icon_add_home_theme_white from '@/assets/icon_add_home_theme_white.png'

export default function AddFavorite({ theme = 'white', onAddHome }) {

    //添加桌面
    const onHandleAddHomeClick = async () => {
        onAddHome && onAddHome()
    }

    if ((theme === 'white')) {
        return <div className="addFavoriteRoot">
            <div className="rowAlignStartFullWidth proofHorPadding16Px" onClick={onHandleAddHomeClick}>
                <img className='addFavoriteIconAddHome addFavoriteRightMargin6Px' src={icon_add_home} alt='' />
                <span className='addFavoriteTitleAddHome'>Add website to home screen</span>
                <img className='addFavoriteIconAddHome' src={icon_add_home_theme} alt='' />
            </div>
        </div>
    } else {
        return <div className="addFavoriteRootTransparent">
            <div className="rowAlignStartFullWidth proofHorPadding16Px" onClick={onHandleAddHomeClick}>
                <img className='addFavoriteIconAddHome addFavoriteRightMargin6Px' src={icon_add_home_white} alt='' />
                <span className='addFavoriteTitleAddHome addFavoriteTitleColorWhite'>Add website to home screen</span>
                <img className='addFavoriteIconAddHome' src={icon_add_home_theme_white} alt='' />
            </div>
        </div>
    }
};
